#!/bin/bash

# 编译并运行CUnit测试
echo "正在构建并运行CUnit测试..."
gcc -o cunit_tests test_find_sub_str_cunit.c -lcunit
if [ $? -eq 0 ]; then
    ./cunit_tests
else
    echo "CUnit测试构建失败"
fi

echo -e "\n----------------------------------------\n"

# 编译并运行CMocka测试
echo "正在构建并运行CMocka测试..."
gcc -o cmocka_tests test_find_sub_str_cmocka.c -lcmocka
if [ $? -eq 0 ]; then
    ./cmocka_tests
else
    echo "CMocka测试构建失败"
fi

# 清理生成的文件
rm -f cunit_tests cmocka_tests